home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-06-24 | 1.9 KB | 75 lines | [TEXT/MPS ] |
- // Copyright © 1994-95 by Apple Computer, Inc. All rights reserved.
- // UShapeList.h
-
- #ifndef __USHAPELIST__
- #define __USHAPELIST__
-
- #ifndef __USHAPES__
- #include "UShapes.h"
- #endif
-
- #ifndef __ULIST__
- #include <UList.h>
- #endif
-
- #ifndef __ULISTITERATOR__
- #include <UListIterator.h>
- #endif
-
- //--------------------------------------------------------------------------------------------------
- // Function types for TShapeList iteration
-
- typedef void(* DoToShapeType)(TShape* item, void* staticLink);
-
- typedef Boolean (*TestShapeType)(TShape* item, void* staticLink);
-
- //--------------------------------------------------------------------------------------------------
- // Shape List class
- //----------------------------------------------------------------------------------------
- class TShapeList : public TList
- {
- MA_DECLARE_CLASS;
-
- public:
- TShapeList(); // Obligatory Constructor
-
- TShape* ShapeAt(ArrayIndex index);
-
- void Each(DoToShapeType DoToShape, void* staticLink);
-
- TShape* FirstThat(TestShapeType TestShape, void* staticLink);
-
- virtual TShape* IterateTil(TestShapeType TestShape,
- void* staticLink,
- Boolean IterateForward,
- ArrayIndex& itsIndex);
- };
-
- //--------------------------------------------------------------------------------------------------
- // Shape Iterator class
- //--------------------------------------------------------------------------------------------------
- class CShapeIterator : public CArrayIterator
- {
- public:
- CShapeIterator (TShapeList* itsList,
- ArrayIndex itsLowBound,
- ArrayIndex itsHighBound,
- Boolean itsForward);
-
- CShapeIterator(TShapeList* itsList, Boolean itsForward = kIterateForward);
-
- virtual ~CShapeIterator();
-
- TShape* CurrentShape();
- // Returns the current shape
-
- TShape* FirstShape();
- // Resets the iteration and returns the first shape in the iteration
-
- TShape* NextShape();
- // Advances the iteration and then returns the shape
- };
-
-
- #endif
-